<?php /*a:6:{s:40:"F:\WWW\youni\view\admin\data\import.html";i:1568170115;s:40:"F:\WWW\youni\view\admin\common\base.html";i:1570370238;s:42:"F:\WWW\youni\view\admin\common\header.html";i:1567752197;s:39:"F:\WWW\youni\view\admin\common\css.html";i:1570602032;s:42:"F:\WWW\youni\view\admin\common\footer.html";i:1567752456;s:38:"F:\WWW\youni\view\admin\common\js.html";i:1570520786;}*/ ?>


    <!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="renderer" content="webkit">

    <title>优你后台</title>

    <meta name="keywords" content="H+后台主题,后台bootstrap框架,会员中心主题,后台HTML,响应式后台">
    <meta name="description" content="H+是一个完全响应式，基于Bootstrap3最新版本开发的扁平化主题，她采用了主流的左右两栏式布局，使用了Html5+CSS3等现代技术">

    <!--[if lt IE 9]>
    <meta http-equiv="refresh" content="0;ie.html" />
    <![endif]-->



    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon"/>

<link href="/static/admin/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
<link href="/static/admin/css/font-awesome.min.css?v=4.4.0" rel="stylesheet">
<link href="/static/admin/css/animate.css" rel="stylesheet">
<link href="/static/admin/css/style.css?v=4.1.0" rel="stylesheet">
<link href="/static/admin/css/plugins/iCheck/custom.css" rel="stylesheet">
<link href="/static/admin/css/plugins/sweetalert/sweetalert.css" rel="stylesheet">
<link href="/static/admin/css/plugins/switchery/switchery.css" rel="stylesheet">
<link href="/static/admin/css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">

<link href="/static/admin/css/plugins/fileinput/fileinput.css" rel="stylesheet">
<link href="/static/admin/css/common.css" rel="stylesheet">

<style>
    .table > tbody > tr {
        text-align: center;
    }
    .table tr>th{
        text-align: center;
    }
    .dropdown-menu > .active > a{
        /*background-color:#1ab394;*/
    }
</style>
</head>







<div class="animated fadeInRight">
    <!-- Panel Other -->
    <div class="ibox float-e-margins">
        <div class="ibox float-e-margins">
            <div class="ibox-title">
                <h5>sql文件列表(备份文件数量：<?php echo htmlentities($filenum); ?>，占空间大小：<?php echo htmlentities(format_bytes($total)); ?>)</h5>
            </div>
            <div class="ibox-content">
                <form id="export-form" method="post" action="<?php echo url('export'); ?>">
                    <table class="table table-bordered">
                        <thead>
                        <tr>
                            <th>备份名称</th>
                            <th>卷数</th>
                            <th>压缩</th>
                            <th>数据大小</th>
                            <th>备份时间</th>
                            <th>状态</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        <?php if(!(empty($data) || (($data instanceof \think\Collection || $data instanceof \think\Paginator ) && $data->isEmpty()))): if(is_array($data) || $data instanceof \think\Collection || $data instanceof \think\Paginator): $i = 0; $__LIST__ = $data;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?>
                        <tr>
                            <td><?php echo htmlentities($vo['basename']); ?></td>
                            <td><?php echo htmlentities($vo['part']); ?></td>
                            <td><?php echo htmlentities($vo['compress']); ?></td>
                            <td><?php echo htmlentities(format_bytes($vo['size'])); ?></td>
                            <td><?php echo htmlentities($vo['time']); ?></td>
                            <td>-</td>
                            <td>
                                <a class="btn btn-primary btn-xs btn-outline db-import" href="<?php echo url('revert',['time'=>$vo['time']]); ?>">还原</a>
                                <a class="btn btn-danger btn-xs btn-outline" onclick="del('<?php echo htmlentities($vo['time']); ?>')">删除</a>
                            </td>
                        </tr>
                        <?php endforeach; endif; else: echo "" ;endif; else: ?>
                        <td colspan="7" class="text-center"> 暂未发现数据库表! </td>
                        <?php endif; ?>
                        </tbody>
                    </table>
                </form>
            </div>
        </div>
    </div>
</div>



    



    <!-- 全局js -->
<script src="/static/admin/js/jquery.min.js?v=2.1.4"></script>
<script src="/static/admin/js/bootstrap.min.js?v=3.3.6"></script>
<script src="/static/admin/js/plugins/metisMenu/jquery.metisMenu.js"></script>
<script src="/static/admin/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
<script src="/static/admin/js/plugins/layer/layer.min.js"></script>
<script src="/static/admin/js/plugins/iCheck/icheck.min.js"></script>
<script src="/static/admin/js/plugins/switchery/switchery.js"></script><!--IOS开关样式-->

<!-- 自定义js -->
<script src="/static/admin/js/hplus.js?v=4.1.0"></script>
<script src="/static/admin/js/contabs.js"></script>
<script src="/static/admin/js/content.js"></script>

<script src="/static/admin/js/plugins/bootstrap-table/bootstrap-table.min.js"></script>
<script src="/static/admin/js/plugins/bootstrap-table/bootstrap-table-mobile.min.js"></script>
<script src="/static/admin/js/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script>
<!-- 第三方插件 -->
<!--<script src="/static/admin/js/plugins/pace/pace.min.js"></script>-->
<script src="/static/admin/js/plugins/fileinput/fileinput.js"></script>
<script src="/static/admin/js/plugins/fileinput/fileinput_locale_zh.js"></script>
<!-- 欢迎信息 -->
<script src="/static/admin/js/welcome.js"></script>


<script src="/static/admin/js/common.js"></script>

<script src="/static/admin/js/ry-ui.js"></script>
<script>
    $(document).ready(function(){
        $(".i-checks").iCheck({checkboxClass:"icheckbox_square-green",radioClass:"iradio_square-green"});
        //IOS开关样式配置
        var elem = document.querySelector('.js-switch');
        var switchery = new Switchery(elem, {
            color: '#1AB394'
        });
        var config = {
            '.chosen-select': {},
        }
    });

</script>



<script>
    $(function () {
        $(".db-import").click(function () {
            var self = this, status = ".";
            $.get(self.href, success, "json");
            window.onbeforeunload = function () { return "正在还原数据库，请不要关闭！";};
            return false;
            function success(data) {
                if (data.code) {
                    if (data.data.gz) {
                        data.msg += status;
                        if (status.length === 5) {
                            status = ".";
                        } else {
                            status += ".";
                        }
                    }
                    $(self).parent().prev().text(data.msg);
                    if (data.data.part) {
                        $.get(self.href, {"part": data.data.part, "start": data.data.start}, success, "json");
                    } else {
                        window.onbeforeunload = function () {return null;};
                    }
                } else {
                    layer.alert(data.msg,0);
                }
            }
        });
    });
    function del(time) {
        $.post("<?php echo url('data/del'); ?>",{time:time},function (res) {
            if(res.code){
                layer.msg(res.msg,{icon:1,time:2000},function () {
                    window.location.reload();
                });
            }else{
                layer.msg(res.msg,{icon:2,time:2000});
            }
        })
    }

</script>
